import { ftSetting } from '@/service/modules/home';
import { useEffect, useState } from 'react';

export default () => {
  const [headerAteFlag, setHeaderAteFlag] = useState(true);
  const [loading, setLoading] = useState(true);
  const [setting, setSetting] = useState<any>({});

  useEffect(() => {
    // 获取设置
    ftSetting().then((res) => {
      console.log(res);
      const { code, data, message } = res;
      if (code === 200) {
        setSetting(data);
      }
    });
  }, []);

  return {
    headerAteFlag,
    setHeaderAteFlag,
    loading,
    setLoading,
    setting
  };
};
